package com.example.demo.controller;

import com.example.demo.common.JsonResult;
import com.example.demo.entity.EmployeeEntity;
import com.example.demo.service.EmployeeSCXService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * ログイン Controller
 */
@RestController
@ResponseBody
public class EmployeeSCXController {

	@Resource
	public EmployeeSCXService employeeSCXService;

	/**
	 * ログイン
	 *
	 * @param name,code,password
	 * @return JsonResult
	 */
	@GetMapping("/bff/scx/login")
	public JsonResult select(@RequestParam("name") String name,
			                 @RequestParam("code") String code,
			                 @RequestParam("password") String password) {

		EmployeeEntity employee = employeeSCXService.select(name, code, password);

		return JsonResult.success(employee);

	}
}
